//获取当前用户的状态 返回 分享者 员工用户id 用户id
const _ = require('./underscore.js'),
  app = getApp();
let isEmployee = 0; // 1 用户 2 员工

module.exports = () => {
  //获取当前页面 参数
  let {
    shareEmployeeId = '',
    shareUserId = ''
  } = app.getTrack();
  //判断当前用户是否是员工
  let {
    employeeInfo = {},
    userInfo = {},
    isEmployee = false
  } = xhs.getStorageSync('isEmployee');
  if (!isEmployee) {
    shareUserId = userInfo.id;
  } else {
    shareEmployeeId = userInfo.id;
    shareUserId = userInfo.id;
  }
  let promise = new Promise((resolve, reject) => {
    resolve({
      isEmployee,
      shareEmployeeId,
      shareUserId
    });
  });
  return promise;
};